package com.yan.demo.loopdemo;

import java.util.Scanner;

public class LoopDemo2 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        if(n < 2){
            System.err.println("输入的数据不合法");
            return;
        }
        boolean flag = true;
        for (int i = 2 ; i < n ; i++){
            if(n % i == 0){
                flag = false;
                break;
            }
        }
        if(flag == true){
            System.out.println(n + "是质数");
        }else {
            System.out.println(n + "不是质数");
        }
    }
}
